package cn.ahaiahaixx.supemarketonline.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.ahaiahaixx.supemarketonline.aop.NeedUser;
import cn.ahaiahaixx.supemarketonline.entity.TbUser;
import cn.ahaiahaixx.supemarketonline.model.TbUserModel;
import cn.ahaiahaixx.supemarketonline.service.UserService;
import cn.ahaiahaixx.supemarketonline.utils.JsonMessage;

/**
 * 用户操作
 * 
 * @author Aiden Pearce
 *
 */
@RestController
@RequestMapping("/tbuser")
public class UserUserController implements NeedUser {
  //登录校验完成
  @Autowired
  private UserService userService;


  @RequestMapping("/userupdate")
  public JsonMessage userupdate(TbUserModel model) throws Exception {
    return userService.userupdate(model);
  }
  //{"tbUser.auid":"1","tbUser.password":"1299","tbUser.nickname":"1299"}
  //成功


  // 登录用户信息
  private TbUser user;

  @Override
  public TbUser getUser() {
    return user;
  }

  @Override
  public void setUser(TbUser user) {
    this.user = user;
  }

}
